package org.daidai.abstrusewriting.homepage.live.networks;

import org.json.JSONObject;
public abstract class AbstactHttpUtils {
    public JSONObject doGet(String url) {
        JSONObject ret=null;
        byte[] bytes = doGetData(url);
        if (bytes != null) {
            try {
                String s = new String(bytes, "UTF-8");
                ret = new JSONObject(s);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return ret;
    }

    public  abstract  byte[] doGetData(String url);
    //异步的GET 请求，请求在子线程中
    public  abstract  void doGetDataAsync(String url,HttpTools tools);
}
